package aps

import glory.xxd.Utils
import org.json.JSONObject
import org.json.XML

/**
 * 批次当前信息查询
 *
 * <Request>
 <Header>
 <TRANSACTIONID>dae4c6b3-fea8-4bdd-aefb-a12da5768341</TRANSACTIONID>
 <MESSAGENAME>SearchLotInfo</MESSAGENAME>
 <USERNAME>EAP</USERNAME>
 </Header>
 <Body class="Body">
 <LotId>LESD8D5.0C^2ES033050P1YL-155^88ASB01971L^S5H22292-001</LotId>
 </Body>
 </Request>
 */
class SearchLotInfoController {

    def commentService

    def index() {

        def LotId = params.LotId ?: ""
        String logUUID = Utils.getUUID();

        def reqeustAll = JSONObject.newInstance()
        def Header = JSONObject.newInstance()
        Header.put("MESSAGENAME","SearchLotInfo")
        Header.put("USERNAME","EAP")
        Header.put("TRANSACTIONID",logUUID)

        def Body = JSONObject.newInstance()
        Body.put("LotId",LotId)

        reqeustAll.put("Header",Header)
        reqeustAll.put("Body",Body)

        def allJSON = [Header:Header,Body:Body]//JSONObject.newInstance()
            //allJSON.put("Request",reqeustAll)
        def jsonRequest = JSONObject.newInstance()
        jsonRequest.put("Request",allJSON)

        def json = commentService.getJsonByObjectForQueue2Queue(logUUID,jsonRequest)

        render json
    }
}
